import java.util.HashMap;
import java.util.Date;



public class SportsEventID {
	
	Integer id;
	
	public SportsEventID( Integer id ){
		this.id = id;
	}
	
	public static class EventIDGenerator {
		
		static int newestId = 0;
		static HashMap<String, Integer> keyMap = new HashMap<String, Integer>(100); 
		
	
		static SportsEventID generateID( String home, String away, Date d) {
			String key = generateKey(home, away, d);
			
			Integer eventId;
			if( !keyMap.containsKey(key)) {
				System.out.println("new key insertion");
				eventId = ++newestId;
				keyMap.put(key, eventId);
			}
			
			eventId = keyMap.get(key);
			
			return new SportsEventID(eventId);
		}
		
		static String generateKey(String home, String away, Date d) {
			String concatenation = home.concat("vs.".concat(away+" ")).concat(d.toString());
			return concatenation;
		}
		
	}	
	

}
